package com.pkcargo.entity.cargo;

import com.pkcargo.entity.IdEntity;
import com.pkcargo.entity.search.Metadata;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2009-5-7
 * Time: 15:36:19
 * To change this template use File | Settings | File Templates.
 */
@Entity
//表名与类名不相同时重新定义表名.
@Table(name = "Corps")
//默认的缓存策略.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Corp extends IdEntity {
    private String content;
    private String contact;
    private Metadata metadata;//元数据，用于查询和列表

    @OneToOne(cascade = {CascadeType.ALL})
    @JoinColumn(name = "metadata_id", nullable = false)
    public Metadata getMetadata() {
        return metadata;
    }

    public void setMetadata(Metadata metadata) {
        this.metadata = metadata;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }
}
